const express = require('express');
const router = express.Router();
const productController = require('@controllers/admin/product.controller');
const { adminAuth } = require('@middlewares/auth');

// 商品列表
router.get('/', adminAuth, productController.getProducts);

// 获取商品详情
router.get('/:id', adminAuth, productController.getProduct);

// 创建商品
router.post('/', adminAuth, productController.createProduct);

// 更新商品
router.put('/:id', adminAuth, productController.updateProduct);

// 删除商品
router.delete('/:id', adminAuth, productController.deleteProduct);

// 更新商品状态
router.put('/:id/status', adminAuth, productController.updateStatus);

// 批量删除商品
router.post('/batch/delete', adminAuth, productController.batchDelete);

// 批量更新商品状态
router.post('/batch/status', adminAuth, productController.batchUpdateStatus);

module.exports = router; 